﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace BridgeV2
{
    public abstract class Tank  //抽象实体
    {
        protected TankPlatFormImport TankPlat;
        public string TankType { get; set; }
        public abstract void Short();
        public abstract void Run();
        public abstract void Stop();

        public Tank(TankPlatFormImport tank)
        {
            this.TankPlat = tank;
        }

        //更换平台和获取平台信息
        public TankPlatFormImport TankPlatProperty {
            get { return this.TankPlat; }
            set { this.TankPlat = value; } }
    }

    public abstract class TankPlatFormImport  //抽象与平台相关的
    {
        public string  PlatformType { get; set; }
        public abstract void MoveTank(Point point);
        public abstract void DrawTank();
        public abstract void DoShort();

    }

    public class T50 : Tank   //其中一种坦克型号
    {
        public T50(TankPlatFormImport tankPlat):base(tankPlat)
        {
            this.TankType = "坦克类型：T50";
        }
        public override void Run()
        {
            Point p = new Point();
            this.TankPlat.MoveTank(p);
        }

        public override void Short()
        {
            this.TankPlat.DoShort();
        }

        public override void Stop()
        {
            this.TankPlat.DrawTank();
        }
    }

    public class PcPlatform : TankPlatFormImport  //电脑平台
    {
        public PcPlatform()
        {
            this.PlatformType = "Pc 机电脑";
        }
        
        public override void DoShort()
        {
            Console.WriteLine(this.PlatformType+ " DoShort");
        }

        public override void DrawTank()
        {
            Console.WriteLine(this.PlatformType + " DrawTank");
        }

        public override void MoveTank(Point point)
        {
            Console.WriteLine(this.PlatformType + " MoveTank");
        }
    }

    public class AppPlatform : TankPlatFormImport  //手机平台
    {
        public AppPlatform()
        {
            this.PlatformType = "手机平台";
        }
        public override void DoShort()
        {
            Console.WriteLine(this.PlatformType + " DoShort");
        }

        public override void DrawTank()
        {
            Console.WriteLine(this.PlatformType + " DrawTank");
        }

        public override void MoveTank(Point point)
        {
            Console.WriteLine(this.PlatformType + " MoveTank");
        }
    }
}
